package com.sheepjin.design_pattern.行为型模式.模板模式.entity;

/**
 * @Author yangjin
 * @Description 模板类
 * @Date 2022/5/31/下午 4:47
 **/
public abstract class Game {

    abstract void initialize();

    abstract void eat();

    abstract void sleep();

    abstract void beatBean();

    //模板
    public final void playGame(){

        System.out.println("-----------------------------------------------");
        System.out.println("=====================>>>>>>>>>>>>>>>开始初始化游戏");
        System.out.println("=====================>>>>>>>>>>>>>>>80%");
        //初始化
        initialize();

        //吃饭
        eat();

        //睡觉
        sleep();

        //打豆豆
        beatBean();
        System.out.println("-----------------------------------------------");
    }
}
